<template>
  <div class='aa' ref="bb">
    
  </div>
</template>

<script setup lang='ts'>
import * as echarts from 'echarts'
import {ref,reactive,onMounted,defineProps,watch} from 'vue'
const {option}=defineProps(['option'])

const bb=ref()
let myChart
onMounted(()=>{
  myChart=echarts.init(bb.value)
  myChart.setOption(option)
})
watch(option,()=>{
 myChart.setOption(option)
})

</script>

<style scoped lang="scss">
.aa{
  width: 500px;
  height: 500px;
}
</style>
